﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SqlCe4Mvc3Application1.Models
{
    public partial class _Settings_ContentPartFieldDefinitionRecord : RaisingStudio.Data.Expressions.TableExpression, RaisingStudio.Data.Expressions.IQueryExpression<_Settings_ContentPartFieldDefinitionRecord>
    {
        #region Constructor (s) / Destructor
        /// <summary>
        /// Constructor (s) / Destructor.
        /// </summary>
        public _Settings_ContentPartFieldDefinitionRecord() : base("Settings_ContentPartFieldDefinitionRecord")
        {
        }
        #endregion
        #region Members
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _Id = "Id";
        public RaisingStudio.Data.Expressions.ColumnExpression Id { get { return _Id; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _Name = "Name";
        public RaisingStudio.Data.Expressions.ColumnExpression Name { get { return _Name; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _Settings = "Settings";
        public RaisingStudio.Data.Expressions.ColumnExpression Settings { get { return _Settings; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _ContentFieldDefinitionRecord_id = "ContentFieldDefinitionRecord_id";
        public RaisingStudio.Data.Expressions.ColumnExpression ContentFieldDefinitionRecord_id { get { return _ContentFieldDefinitionRecord_id; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _ContentPartDefinitionRecord_Id = "ContentPartDefinitionRecord_Id";
        public RaisingStudio.Data.Expressions.ColumnExpression ContentPartDefinitionRecord_Id { get { return _ContentPartDefinitionRecord_Id; } }

		#endregion

        public static implicit operator RaisingStudio.Data.Expressions.ConditionExpression(_Settings_ContentPartFieldDefinitionRecord Settings_ContentPartFieldDefinitionRecord)
        {
            return new RaisingStudio.Data.Expressions.ConditionExpression();
        }

        public RaisingStudio.Data.Expressions.ConditionExpression OrderBy(RaisingStudio.Data.Expressions.ColumnExpression columnExpression)
        {
             RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
             return conditionExpression.OrderBy(columnExpression);
        }

        public RaisingStudio.Data.Expressions.ConditionExpression OrderBy(RaisingStudio.Data.Expressions.ColumnExpression columnExpression, RaisingStudio.Data.Expressions.SortingDirection sortingDirection)
        {
            RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
            return conditionExpression.OrderBy(columnExpression, sortingDirection);
        }

        public RaisingStudio.Data.Expressions.ConditionExpression Where(RaisingStudio.Data.Expressions.ExpressionElement expressionElement)
        {
            RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
            return conditionExpression.Where(expressionElement);
        }

        public static implicit operator RaisingStudio.Data.Expressions.ColumnExpressionCollection(_Settings_ContentPartFieldDefinitionRecord Settings_ContentPartFieldDefinitionRecord)
        {
            return new RaisingStudio.Data.Expressions.ColumnExpressionCollection(Settings_ContentPartFieldDefinitionRecord);
        }

        public static implicit operator RaisingStudio.Data.Expressions.ColumnExpression[](_Settings_ContentPartFieldDefinitionRecord Settings_ContentPartFieldDefinitionRecord)
        {
            return new RaisingStudio.Data.Expressions.ColumnExpression[]
                        {                            
                            Settings_ContentPartFieldDefinitionRecord.Id,
                            Settings_ContentPartFieldDefinitionRecord.Name,
                            Settings_ContentPartFieldDefinitionRecord.Settings,
                            Settings_ContentPartFieldDefinitionRecord.ContentFieldDefinitionRecord_id,
                            Settings_ContentPartFieldDefinitionRecord.ContentPartDefinitionRecord_Id,
                        };
        }

        public RaisingStudio.Data.Expressions.ColumnExpressionCollection Except(params RaisingStudio.Data.Expressions.ColumnExpression[] columns)
        {
            RaisingStudio.Data.Expressions.ColumnExpressionCollection columnExpressionCollection = this;
            return columnExpressionCollection.Except(columns);
        }

    
        public static implicit operator RaisingStudio.Data.Expressions.QueryExpression<_Settings_ContentPartFieldDefinitionRecord>(_Settings_ContentPartFieldDefinitionRecord Settings_ContentPartFieldDefinitionRecord)
        {
            return new RaisingStudio.Data.Expressions.QueryExpression<_Settings_ContentPartFieldDefinitionRecord>(Settings_ContentPartFieldDefinitionRecord);
        }


        #region IQueryExpression<_Settings_ContentPartFieldDefinitionRecord> 成员

        _Settings_ContentPartFieldDefinitionRecord RaisingStudio.Data.Expressions.IQueryExpression<_Settings_ContentPartFieldDefinitionRecord>.Value
        {
            get { return Settings_ContentPartFieldDefinitionRecord._; }
        }

        #endregion

        #region IQueryExpression 成员

        RaisingStudio.Data.Expressions.TableExpression RaisingStudio.Data.Expressions.IQueryExpression.Table
        {
            get { return this; }
        }

        RaisingStudio.Data.Expressions.ConditionExpression RaisingStudio.Data.Expressions.IQueryExpression.Condition
        {
            get { return this; }
        }

        RaisingStudio.Data.Expressions.ColumnExpressionCollection RaisingStudio.Data.Expressions.IQueryExpression.Columns
        {
            get { return null; }
        }

        #endregion
    }

    partial class Settings_ContentPartFieldDefinitionRecord
    {
        #region Members
        public static readonly _Settings_ContentPartFieldDefinitionRecord _ = new _Settings_ContentPartFieldDefinitionRecord();
		#endregion
    }
}
